Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to boxo with refactored providerQueryManager. #10595

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hsanjuan
Copy link
Contributor

No description provided.

@hsanjuan hsanjuan force-pushed the feat/boxo-641-integration branch 9 times, most recently from e949039 to 2012782 Compare November 21, 2024 16:53
@hsanjuan
Copy link
Contributor Author

This is testing ipfs/boxo#641

@hsanjuan hsanjuan force-pushed the feat/boxo-641-integration branch 3 times, most recently from ecb88f2 to f46134c Compare November 21, 2024 21:51
@hsanjuan
Copy link
Contributor Author

@aschmahmann I have a problem: before, bitswap reprovided new blocks "immediately". Now, they are sent to the reprovider.System, which reprovides them when it likes, but not immediately.

The question is:

  • Whether I find a way to provide those immidiately like before (will have to port the queuing logic and call the underlying provider directly)
  • Whether I change failing tests and manually call reproviding so that they pass.

Opinions?

@hsanjuan hsanjuan marked this pull request as ready for review November 21, 2024 22:23
@hsanjuan hsanjuan requested a review from a team as a code owner November 21, 2024 22:23
@aschmahmann
Copy link
Contributor

@hsanjuan would you agree that this change in behavior seems more like a test issue than a production one? If so then what we do next seems like a matter of expediency vs maintenance.

For some of these tests it'd probably be nice to confirm that automatic providing works so we know if something breaks later. The reason this isn't working in tests is because this option https://github.com/ipfs/boxo/blob/c91cc1d5a0552c653936bd5051b6c0972d57743c/provider/reprovider.go#L226 (which is not exposed except for tests) defaults to waiting for 1 minute of uptime before providing to prevent wasted effort (e.g. if people run ipfs add but the daemon isn't running).

So there are some other options as well:

  1. Remove the 1 minute timeout entirely (I'm pretty sure we wanted it for a reason, so may need to investigate more here on if removal is safe)
  2. Modify how we do the tests to in some way allow setting that option (e.g. using the "Internal" section of the config, a test plugin with variables we can set in the config, etc.). It's not great that this would require building the test code / plugin into the main binary, but not necessarily so bad.

Not sure which option makes the most sense, part of me says that we should do whatever behavior we want to see normal users experience and compromise on if there's some grossness in the final binary / code related to testing (e.g. using the Internal config section or a test config section).

@hsanjuan
Copy link
Contributor Author

hsanjuan commented Nov 22, 2024

I can fix the failing tests by manually calling "ipfs bitswap reprovide" after adding.

What I'm wondering is whether users expect that after running "ipfs add", the new content should be provided immediately (because they add and then try to open it on the gateway etc).

There are also a number of underlying issues:

  • If reprovided is set to "roots", it seems right now (in master) we are providing every block as they get added regardless.
  • It seems now we are bypassing accelerated providing (in master) and announcing every block individually when adding.
  • etc.

Perhaps the best is to trigger a re-provide right after adding something... but perhaps that provides other things first so it's also not perfect.

@hsanjuan hsanjuan force-pushed the feat/boxo-641-integration branch 2 times, most recently from 229a670 to 47a8cf0 Compare November 22, 2024 13:38
@hsanjuan
Copy link
Contributor Author

After a quick discussion: what is happening is that the reprovider has an initialDelay and that's it. Otherwise it is going to provide blocks very quickly just like it happened below, except better. So the solution is to call Reprovide on the tests that need it by hand and move on.

Comment on lines +93 to +101
func OnlineExchange() interface{} {
return func(in *bitswap.Bitswap, lc fx.Lifecycle) exchange.Interface {
lc.Append(fx.Hook{
OnStop: func(ctx context.Context) error {
return in.Close()
},
})
return in
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One day this might be not just bitswap, but bitswap + http etc.

@lidel lidel mentioned this pull request Nov 22, 2024
24 tasks
Comment on lines +65 to +67
if res.Err != nil {
t.Fatal(res.Err)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: use require here and in other tests.

Suggested change
if res.Err != nil {
t.Fatal(res.Err)
}
require.NoError(t, res.Err)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants